/*

 * Licensed to the Apache Software Foundation (ASF) under one

 * or more contributor license agreements.  See the NOTICE file

 * distributed with this work for additional information

 * regarding copyright ownership.  The ASF licenses this file

 * to you under the Apache License, Version 2.0 (the

 * "License"); you may not use this file except in compliance

 * with the License.  You may obtain a copy of the License at

 *

 *     http://www.apache.org/licenses/LICENSE-2.0

 *

 * Unless required by applicable law or agreed to in writing, software

 * distributed under the License is distributed on an "AS IS" BASIS,

 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

 * See the License for the specific language governing permissions and

 * limitations under the License.

 */

package com.bff.gaia.unified.sdk.loadtests;



import com.bff.gaia.unified.sdk.options.*;

import com.bff.gaia.unified.sdk.options.ApplicationNameOptions;

import com.bff.gaia.unified.sdk.options.Default;

import com.bff.gaia.unified.sdk.options.Description;

import com.bff.gaia.unified.sdk.options.PipelineOptions;

import com.bff.gaia.unified.sdk.options.PipelineOptionsFactory;

import com.bff.gaia.unified.sdk.options.StreamingOptions;

import com.bff.gaia.unified.sdk.options.Validation;



import javax.annotation.Nullable;



/** Common interface for all load test options. */

public interface LoadTestOptions extends PipelineOptions, ApplicationNameOptions, StreamingOptions {



  @Description("Options for synthetic source")

  @Validation.Required

  String getSourceOptions();



  void setSourceOptions(String sourceOptions);



  @Description("Options for synthetic step")

  String getStepOptions();



  void setStepOptions(String stepOptions);



  @Description("Whether the results should be published to BigQuery database")

  @Default.Boolean(false)

  Boolean getPublishToBigQuery();



  void setPublishToBigQuery(Boolean publishToBigQuery);



  @Description("BigQuery dataset name")

  String getBigQueryDataset();



  void setBigQueryDataset(String dataset);



  @Description("BigQuery table name")

  String getBigQueryTable();



  void setBigQueryTable(String tableName);



  @Description("Timeout for a load test expressed in minutes")

  @Default.Integer(240)

  Integer getLoadTestTimeout();



  void setLoadTestTimeout(Integer timeout);



  @Description("Window duration. If not set global windows will be used.")

  @Nullable

  Long getInputWindowDurationSec();



  void setInputWindowDurationSec(Long windowSizeSec);



  static <T extends LoadTestOptions> T readFromArgs(String[] args, Class<T> optionsClass) {

    return PipelineOptionsFactory.fromArgs(args).withValidation().as(optionsClass);

  }

}